<?php

/**
 * Class Involved_VideoModel
 */
class Involved_VideoModel extends BaseModel{

    protected $table = 'video';

    /**
     * 视频列表
     * @author alice
     * @date 2016-1-19
     * @return mixed
     */
    public function ShowVideoList()
    {
        return  DB::table($this->table)->paginate(8);
    }

    /**
     * 视频详情
     * @param $id
     * @author alice
     * @date 2016-1-19
     * @return mixed
     */
    public function ShowVideoInfo($id)
    {
        return DB::table($this->table)->where('video_id',$id)->first();
    }

    /**
     * 获取视频连接地址
     * @param $type_id
     * @param $video_id
     * @return mixed
     */
    public function VideoPlayUrl($type_id, $video_id)
    {
            return DB::table($this->table)
                ->select('video_url')
                ->where(['type_id' => $type_id, 'video_id' => $video_id])
                ->first();
    }


}